

##### User Config Begin ####

BasicCore=(
sudo zsh git zip curl htop vim dhcpcd dos2unix libpng12 cifs-utils nfs-utils openssh autojump cmake file-roller rar unzip wget
)

HwManager=(
    iwd
)


SystemAppList="networkmanager xorg-server wqy-zenhei"

CommonAppList="jre8-openjdk zeal archlinuxcn-keyring samba yay yaourt terminator screenfetch"

EditAppList="vim gedit geany notepadqq typora visual-studio-code-bin sublime-text-imfix"

EssentialAppList="google-chrome teamviewer fcitx-sogoupinyin fcitx-qt4 fcitx-configtool"

LateAppList="smplayer flex bison gperf python-markdown libxml2 gnupg bison gcc-multilib file  m4 ccache perl-switch adb fastboot perl-xml-simple python-pip"


function install_pkg
{
        color_echo -green "$1 " -reset 2>&1 | tee install.log
        sudo pacman -S  --noconfirm $1 >> install.log 2>&1
        if [ "$?" = "0" ];then
            color_echo -green '\033[40G' "$?" -n -reset 2>&1  | tee -a install.log
        else
            color_echo -red '\033[40G' "$?" -n -reset 2>&1  | tee -a install.log
        fi
}


function InstallApplication
{
    sudo pacman -Sy
    #for pkg in $SystemAppList
    #do
    #    install_pkg $pkg
    #done

    for pkg in $CommonAppList
    do
        install_pkg $pkg
    done

    for pkg in $EditAppList
    do
        install_pkg $pkg
    done

    for pkg in $LateAppList
    do
        install_pkg $pkg
    done

    for pkg in $EssentialAppList
    do
        install_pkg $pkg
    done

}

function install_base_core()
{
    for pkg in $Basic
    do
        install_pkg $pkg
    done
}

